#pragma once

#include "IMovable.h"
#include <d3dx9.h>


class ICameraImpl;

///////////////////////////////////////////////////////////////////////////////
// With this type of camera you only 'atttach' the camera to the avatar.
// It will keep following it - and that's it.
// So it's important to keep in mind that you don't pass the PhysicalObject
// representing the camera to the InputController.
// You pass the PhysicalObject representing the avatar instead!!!
// Make sure you register both with the CollisionController to avoid 
// the collisions occuring for both the avatar and the camera
///////////////////////////////////////////////////////////////////////////////
class CThirdPersonCamera : public IMovable
{
private:
   ICameraImpl& m_cameraImpl;
   IMovable& m_avatar;

   D3DXVECTOR3 m_cameraOffset;
   float m_cameraLag;

public:
   CThirdPersonCamera(ICameraImpl& cameraImpl, IMovable& avatar);

   void move(const D3DXVECTOR3& transVec);

   void rotate(float pitch, float yaw, float roll);

   inline const D3DXVECTOR3& getRightVec() const;
   inline const D3DXVECTOR3& getUpVec() const;
   inline const D3DXVECTOR3& getLookVec() const;
   inline const D3DXVECTOR3& getPosition() const;

   void update(float timeElapsed);

   AABoundingBox getWorldSpaceBoundingBox() const;
};
